/**
  ******************************************************************************
  * @file    led.h
  * @author  John Doe <vjkqxz@gmail.com>
  * @version V0.0.1
  * @date    15-July-2017
  * @brief   This file contains all the functions prototypes for the LED firmware 
  *          library.
  * @note    This is an example file that show you the code style of driver.
  ******************************************************************************
  * @attention
  *
  * NO ATTENTION!
  *
  * <h2><center>&copy; COPYRIGHT 2017 </center></h2>
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __LED_H
#define __LED_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
#include "stm32f10x_gpio.h"

/* LED Type definition */
typedef uint8_t LEDType;
typedef enum {ON = 0, OFF = !ON} LEDCMD, LEDStatus;


#define LED_GPIO_CLK        RCC_APB2Periph_GPIOB
#define LED_Port            GPIOB
#define LED1_Pin            GPIO_Pin_12
#define LED2_Pin            GPIO_Pin_13
#define LED_Pin             ( LED1_Pin \
                            | LED2_Pin)

#define LED                 0
#define LED1                1
#define LED2                2


#define IS_LED_PIN(PERIPH) (((PERIPH) == LED1) || \
                           ((PERIPH) == LED2))

#define IS_LED(PERIPH)     ( IS_LED_PIN(PERIPH) || \
                           ((PERIPH) == LED))

#define IS_CMD(CMD)        (((CMD) == ON) || \
                            ((CMD) == OFF))


void LED_Init(void);
//void LED_DeInit(void);
//void LED_Cmd(LEDType LEDx, LEDCMD cmd);
void LED_On(LEDType LEDx);
void LED_Off(LEDType LEDx);
void LED_Toggle(LEDType LEDx);
LEDStatus LED_Status(LEDType LEDx);

#ifdef __cplusplus
}
#endif

#endif /*__LED_H */
